import java.util.Scanner;
//一个5位数，判断它是不是回文数。即12321是回文数，个位与万位相同，十位与千位相同
public class Program25 {
    public static void main(String[] args) {
        //Scanner类捕获键盘输入
        Scanner console = new Scanner(System.in);
        System.out.print("请输入一个五位数：");
        //用String类型接收数字，便于分割比较
        String number = console.nextLine(),firstHalf,secondHalf = "";
        //firstHalf用于存储前半数字
        firstHalf = number.substring(0,number.length()/2);
        //secondHalf用于存储后半数字
        switch (number.length()){
            //利用switch语句判断位数，以便用for循环切割数字
            case 3:
            case 5:
                for (int i = number.length(); i > number.length()/2+1; i--) {
                    secondHalf += number.substring(i-1,i);
                }
                if (firstHalf.equals(secondHalf)){
                    System.out.println("输入的数字是回文");
                }else {
                    System.out.println("输入的数字不是回文");
                }
                break;
            case 2:
            case 4:
                for (int i = number.length(); i > number.length()/2; i--) {
                    secondHalf += number.substring(i-1,i);
                }
                if (firstHalf.equals(secondHalf)){
                    System.out.println("输入的数字是回文");
                }else {
                    System.out.println("输入的数字不是回文");
                }
                break;
            case 1:
                System.out.println("输入的数字是回文");
                break;
        }
        /*判断for循环切割后的结果是否正确
        System.out.println(firstHalf);
        System.out.println(secondHalf);
        */
    }
}